import request from '@/utils/request'

// 查询会员列表
export function listMember(params) {
  return request({
    url: '/admin/v1/ums/member/list',
    method: 'get',
    params
  })
}

// 查询会员列表
export function listMemberTree(params) {
  return request({
    url: '/admin/v1/ums/member/listMemberTree',
    method: 'get',
    params
  })
}

// 查询会员详细
export function getMember(id) {
  return request({
    url: '/admin/v1/ums/member/' + id,
    method: 'get'
  })
}

// 新增会员
export function addMember(data) {
  return request({
    url: '/admin/v1/ums/member/add',
    method: 'post',
    data
  })
}

// 修改会员
export function updateMember(data) {
  return request({
    url: '/admin/v1/ums/member/update',
    method: 'put',
    data
  })
}

// 修改会员
export function editMember(data) {
  return request({
    url: '/admin/v1/ums/member/edit',
    method: 'put',
    data
  })
}
// 修改代理状态
export function editMemberStatus(data) {
  return request({
    url: '/admin/v1/ums/member/editMemberStatus',
    method: 'put',
    data
  })
}
// 修改代理邀请人
export function editMemberParent(data) {
  return request({
    url: '/admin/v1/ums/member/editMemberParent',
    method: 'put',
    data
  })
}
// 修改代理等级
export function editMemberLevel(data) {
  return request({
    url: '/admin/v1/ums/member/editMemberLevel',
    method: 'put',
    data
  })
}

// 删除会员
export function delMember(data) {
  return request({
    url: '/admin/v1/ums/member/delete',
    method: 'delete',
    data
  })
}

// 导出会员
export function exportMember() {
  return request({
    url: '/admin/v1/ums/member/export',
    method: 'get',
    responseType: 'blob'
  })
}
// 导出会员
export function exportAgentRelation(query) {
  return request({
    url: '/admin/v1/ums/member/exportAgentRelation',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
export function memberList(params) {
  return request({
    url: '/admin/v1/ums/member/memberList',
    method: 'get',
    params
  })
}
